Java: add Apple Silicon macOS in-process runtime and native classifier publishing - #2402
Conversation
There was a problem hiding this comment.
Pull request overview
Adds Java in-process runtime packaging and publication support for Apple Silicon macOS.
Changes:
- Adds
darwin-arm64Maven profiles and native validation. - Extends CI and publication workflows to three classifiers.
- Updates tests and documentation.
Show a summary per file
| File | Description |
|---|---|
java/sdk/pom.xml |
Selects the Darwin test runtime. |
java/copilot-native/pom.xml |
Packages and attaches Darwin artifacts. |
java/copilot-native/scripts/validate-native-host.mjs |
Validates Darwin ARM64 hosts. |
java/copilot-native/scripts/validate-native-host.test.mjs |
Tests Darwin host validation. |
java/copilot-native/scripts/validate-native-artifact.mjs |
Detects native resources across platforms. |
java/copilot-native/scripts/validate-native-artifact.test.mjs |
Tests Darwin artifacts and publications. |
java/copilot-native/scripts/validate-local-publication.mjs |
Requires all three classifiers. |
java/copilot-native/scripts/fetch-native.test.mjs |
Adds Darwin fetch coverage. |
.github/workflows/java-sdk-tests.yml |
Adds Darwin tests and publication assembly. |
.github/workflows/java-publish-maven.yml |
Adds Darwin release publication. |
.github/workflows/java-publish-snapshot.yml |
Adds Darwin snapshot publication. |
java/README.md |
Documents Darwin support. |
java/docs/adr/adr-007-native-bundling-strategy.md |
Records the three-platform strategy. |
2399-embed-rust-java-darwin-arm64-remove-before-merge/20260825-prompts.md |
Adds a temporary session transcript. |
2399-embed-rust-java-darwin-arm64-remove-before-merge/20260825-implement-darwin-arm64.md |
Adds a temporary implementation prompt. |
Review details
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
- Files reviewed: 15/15 changed files
- Comments generated: 2
- Review effort level: Balanced
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
Validate locally
|
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> GUTDODP GUTDODP GUTDOP Remove prompts
03e75cd to
4a0454d
Compare
Cross-SDK Consistency Review ✅This PR extends the Java SDK's experimental in-process native runtime to support Apple Silicon macOS ( All 13 changed files are Java-specific (CI workflows, No cross-SDK consistency issues found. The in-process native runtime is a Java-only experimental feature — it is not part of the shared public API surface (session creation, tool invocation, streaming, etc.) that is mirrored across all SDKs. Adding
|
Implements the
darwin-arm64portion of #2399.Fixes #2400.
Summary
Adds Apple Silicon macOS (
darwin-arm64) as a supported target for the Java SDK's experimental in-process runtime, alongside the existing GNU/Linuxlinux-x64and Windowswin32-x64targets delivered by #2301 and #2393.runtime.node,copilot, andplatform.properties.darwin-arm64classifier automatically on Apple Silicon macOS, including when Maven runs with-Pinprocess.macos-26in addition to the existing Ubuntu and Windows matrix.User experience
In-process mode remains opt-in, experimental, and unchanged for existing Linux and Windows consumers. The SDK's default connection behavior is also unchanged.
An Apple Silicon macOS application enables in-process mode by:
com.github:copilot-sdk-java-runtimewith classifierdarwin-arm64, plus JNA.CopilotClientOptionswithRuntimeConnection.forInProcess().The classifier JAR contains:
For SDK development on Apple Silicon,
mvn -Pinprocess clean verifydetectsdarwin-arm64, validates that the host is macOS ARM64, fetches the pinned@github/copilot-darwin-arm64package, packages its version-matched runtime and transitional CLI, and exercises the in-process integration suite. Intel macOS and other unsupported OS/architecture combinations fail explicit in-process host validation rather than packaging the wrong binary.During the active Rust migration, the classifier intentionally includes the version-matched
copilotembedded-host executable in addition toruntime.node. It can be removed once the native runtime no longer delegates unported method bodies to the CLI.Packaging and publication model
This extends the coordinated publication model introduced by #2393 from two native classifiers to three:
linux-x64runtime.node,copilot, metadatawin32-x64runtime.node,copilot.exe, metadatadarwin-arm64runtime.node,copilot, metadataThe macOS job builds only the
darwin-arm64classifier and a SHA-256 manifest. The sole Ubuntu publisher then:linux-x64locally and performs one deployment containing the neutral SDK artifacts and all three native classifiers.Using one deployment preserves a shared Maven snapshot timestamp/build number and ensures release signing covers every classifier. Snapshot and release summaries now report the build host, filename, and SHA-256 hash for all three classifiers.
CI and safety checks
linux-x64,win32-x64, anddarwin-arm64.macos-26job builds and validates the Darwin publication input before upload.darwin+arm64fordarwin-arm64; Intel macOS and non-macOS hosts are rejected.runtime.node,copilot, and matchingplatform.properties.Validation coverage
mvn -Pinprocess clean verifyin the Java CI matrix.macos-26.